﻿using System;

public class Ray
{
    public Vector3 origin;
    public Vector3 direction;
    public Vector3 destination;
    public float distance;
    public Ray()
    {
        this.origin = new Vector3(0,0,0);
        this.direction = new Vector3(0, 0, 0);
        this.destination = new Vector3(0, 0, 0);
        this.distance = 0;
    }
	public Ray(Vector3 origin, Vector3 direction, bool b)
	{
        if (b)
        {
            this.direction = direction;
        }
        else
        {
            this.direction = direction - origin;
        }
        this.origin = origin;
        this.direction.normalize();
        this.destination = new Vector3(0, 0, 0);
        this.distance = 0;
	}
    public override string ToString()
    {
        return "ray{o" + origin + ", d=" + direction + "}";
    }
}
